package com.zn.util;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Component;

/**
 * @author YinJiaWei
 * @version 2019/1/7 21:40
 */
@Component
public class CSocketInfo {

    @Autowired
    private RedisTemplate<String,String> redisTemplate;

    public String getTradeHost(){
        return redisTemplate.opsForHash().get(Constant.C_ADDRESS,"tradeIp").toString();
    }
    public Integer getTradePort(){
        return Integer.valueOf(redisTemplate.opsForHash().get(Constant.C_ADDRESS, "tradePort").toString());
    }
    public String getMdHost(){
        return redisTemplate.opsForHash().get(Constant.C_ADDRESS,"mdIp").toString();
    }
    public  Integer getMdPort(){
        return Integer.valueOf(redisTemplate.opsForHash().get(Constant.C_ADDRESS, "mdPort").toString());
    }
}
